import { _decorator, Component, find, Label, Node, Slider } from 'cc';
import { Permanent } from './Permanent';
const { ccclass, property } = _decorator;

@ccclass('SpeedUpdate')
export class SpeedUpdate extends Component {
    start() {
        this.node.getComponent(Label).string = Math.trunc(find('Canvas/Setting/Sensitivity').getComponent(Slider).progress*9+1).toString()
    }

    speedUpdate(){
        this.node.getComponent(Label).string = Math.trunc(find('Canvas/Setting/Sensitivity').getComponent(Slider).progress*9+1).toString()
        find('Permanent').getComponent(Permanent).speedUpdate(find('Canvas/Setting/Sensitivity').getComponent(Slider).progress*9+1)
    }

    update(deltaTime: number) {
        
    }
}


